package com.sh.Utils;



import com.sh.bean.BankMarketing_my;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

public class MyLoader {

    public static List<BankMarketing_my> myLoad(String path) {
        List<BankMarketing_my> list = new ArrayList<>();

        Path p = Paths.get(path);

        try (
                InputStream iis = Files.newInputStream(p);
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(iis));
        ) {
            String line = null;
            while ((line = bufferedReader.readLine()) != null) {
                String[] splitData = line.split(";");
                BankMarketing_my bankMarketingMy = new BankMarketing_my();
                bankMarketingMy.setData(splitData);  // 一行放进去
                list.add(bankMarketingMy);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
}
